package org.example.controller.app;


import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.example.result.R;
import org.example.service.IDriverService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotBlank;

@Tag(name = "小程序司机对象",description = "小程序司机对象")
@RestController
@RequestMapping("/app/driver")
public class AppDriverController {

    @Autowired
    private IDriverService driverService;

    @Operation(summary= "司机注册",description = "司机注册接口")
    @PostMapping("/wxRegister/{openIdCode}")
    public R<Boolean> wxRegister(@PathVariable("openIdCode") @NotBlank(message = "参数异常！") String openIdCode){
        driverService.wxRegister(openIdCode);
        return R.success();
    }
}
